'use strict';

module.exports = {
  up: async (queryInterface, Sequelize) => {
    const { STRING } = Sequelize;
    
    // 修改suppliers表中的phone字段长度
    await queryInterface.changeColumn('suppliers', 'phone', {
      type: STRING(50),
      allowNull: true,
      comment: '联系电话'
    });
  },

  down: async (queryInterface, Sequelize) => {
    const { STRING } = Sequelize;
    
    // 恢复phone字段长度为20
    await queryInterface.changeColumn('suppliers', 'phone', {
      type: STRING(20),
      allowNull: true,
      comment: '联系电话'
    });
  }
};